package com.group9.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Arrays;
import java.util.Date;

/**
 * Created by Lcouncillor on 2020/6/5.
 */
@Document(collection = "comment_response")
public class CommentResponse {

    /**
     * 评论回复id
     */
    @Id
    private String id;

    /**
     * 发送者id
     */
    @Field(value = "sender_id")
    private String senderId;

    /**
     * 发送者名
     */
    @Field(value = "sender_name")
    private String senderName;

    /**
     * 发送者头像
     */
    @Field(value = "sender_pic")
    private String senderPic;

    /**
     * 接收者id
     */
    @Field(value = "receiver_id")
    private String receiverId;

    /**
     * 接收者名
     */
    @Field(value = "receiver_name")
    private String receiverName;

    /**
     * 回复内容
     */
    @Field(value = "response_content")
    private String responseContent;

    /**
     * 回复的评论的id, 可以逆向寻找到回复对象
     */
    @Field(value = "parent_id")
    private String parentId;

    /**
     * 回复时间
     */
    @Field(value = "comment_time")
    private Date commentTime;

    /**
     * 对该回复进行回复的回复id数组
     * 当前回复为二级评论，并存在三级评论时，responseId不为null
     */
    @Field(value = "response_id")
    private String[] responseId;

    /**
     * 状态号：2表示二级评论，3...
     */
    private String status;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getSenderPic() {
        return senderPic;
    }

    public void setSenderPic(String senderPic) {
        this.senderPic = senderPic;
    }

    public String getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(String receiverId) {
        this.receiverId = receiverId;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getResponseContent() {
        return responseContent;
    }

    public void setResponseContent(String responseContent) {
        this.responseContent = responseContent;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public Date getCommentTime() {
        return commentTime;
    }

    public void setCommentTime(Date commentTime) {
        this.commentTime = commentTime;
    }

    public String[] getResponseId() {
        return responseId;
    }

    public void setResponseId(String[] responseId) {
        this.responseId = responseId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "CommentResponse{" +
                "id='" + id + '\'' +
                ", senderId='" + senderId + '\'' +
                ", senderName='" + senderName + '\'' +
                ", senderPic='" + senderPic + '\'' +
                ", receiverId='" + receiverId + '\'' +
                ", receiverName='" + receiverName + '\'' +
                ", responseContent='" + responseContent + '\'' +
                 ", parentId='" + parentId + '\'' +
                 ", commentTime=" + commentTime +
                 ", responseId=" + Arrays.toString(responseId) +
                 ", status='" + status + '\'' +
                '}';
    }
}
